<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Paginator::Page</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Paginator::Page</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/vendor/plugins/active_scaffold/lib/paginator_rb.html">
                vendor/plugins/active_scaffold/lib/paginator.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
<a href="Page.html">Page</a> object
</p>
<p>
Retrieves <a href="Page.html#M000010">items</a> for a page and provides
metadata about the position of the page in the paginator
</p>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000015">first_item_number</a>&nbsp;&nbsp;
      <a href="#M000010">items</a>&nbsp;&nbsp;
      <a href="#M000016">last_item_number</a>&nbsp;&nbsp;
      <a href="#M000014">next</a>&nbsp;&nbsp;
      <a href="#M000013">next?</a>&nbsp;&nbsp;
      <a href="#M000012">prev</a>&nbsp;&nbsp;
      <a href="#M000011">prev?</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">number</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">pager</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000015" class="method-detail">
        <a name="M000015"></a>

        <div class="method-heading">
          <a href="#M000015" class="method-signature">
          <span class="method-name">first_item_number</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
The &quot;item number&quot; of the first item on this page
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000015-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/paginator.rb, line 117</span>
117:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">first_item_number</span>
118:       <span class="ruby-value">1</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@offset</span>
119:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000010" class="method-detail">
        <a name="M000010"></a>

        <div class="method-heading">
          <a href="#M000010" class="method-signature">
          <span class="method-name">items</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Retrieve the <a href="Page.html#M000010">items</a> for this page
</p>
<ul>
<li>Caches

</li>
</ul>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000010-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/paginator.rb, line 92</span>
92:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">items</span>
93:       <span class="ruby-ivar">@items</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@select</span>.<span class="ruby-identifier">call</span>
94:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000016" class="method-detail">
        <a name="M000016"></a>

        <div class="method-heading">
          <a href="#M000016" class="method-signature">
          <span class="method-name">last_item_number</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
The &quot;item number&quot; of the last item on this page
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000016-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/paginator.rb, line 122</span>
122:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">last_item_number</span>
123:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">next?</span>
124:         <span class="ruby-ivar">@offset</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@pager</span>.<span class="ruby-identifier">per_page</span>
125:       <span class="ruby-keyword kw">else</span>
126:         <span class="ruby-ivar">@pager</span>.<span class="ruby-identifier">count</span>
127:       <span class="ruby-keyword kw">end</span>
128:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000014" class="method-detail">
        <a name="M000014"></a>

        <div class="method-heading">
          <a href="#M000014" class="method-signature">
          <span class="method-name">next</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Get <a href="Page.html#M000014">next</a> page (if possible)
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000014-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/paginator.rb, line 112</span>
112:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">next</span>
113:       <span class="ruby-ivar">@pager</span>.<span class="ruby-identifier">page</span>(<span class="ruby-ivar">@number</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">next?</span>
114:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000013" class="method-detail">
        <a name="M000013"></a>

        <div class="method-heading">
          <a href="#M000013" class="method-signature">
          <span class="method-name">next?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Checks to see if there&#8216;s a page after this one
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000013-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/paginator.rb, line 107</span>
107:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">next?</span>
108:       <span class="ruby-ivar">@number</span> <span class="ruby-operator">&lt;</span> <span class="ruby-ivar">@pager</span>.<span class="ruby-identifier">number_of_pages</span>
109:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000012" class="method-detail">
        <a name="M000012"></a>

        <div class="method-heading">
          <a href="#M000012" class="method-signature">
          <span class="method-name">prev</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Get previous page (if possible)
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000012-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/paginator.rb, line 102</span>
102:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">prev</span>
103:       <span class="ruby-ivar">@pager</span>.<span class="ruby-identifier">page</span>(<span class="ruby-ivar">@number</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">prev?</span>
104:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000011" class="method-detail">
        <a name="M000011"></a>

        <div class="method-heading">
          <a href="#M000011" class="method-signature">
          <span class="method-name">prev?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Checks to see if there&#8216;s a page before this one
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000011-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/paginator.rb, line 97</span>
97:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">prev?</span>
98:       <span class="ruby-ivar">@number</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
99:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>